<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
		xmlns:p="http://primefaces.org/ui"
			xmlns:h="http://java.sun.com/jsf/html"
				xmlns:f="http://java.sun.com/jsf/core"
					xmlns:ui="http://java.sun.com/jsf/facelets"
						xmlns:pe="http://primefaces.org/ui/extensions">
	<h:head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
		<title>Sistema Inforse WEB</title>
		<link rel="stylesheet" type="text/css" href="/css/inforse.css" />		
	</h:head>
	 
	<h:body style="background-image:url('/imagens/fading_background_17.png');background-repeat:repeat-x;">
		<h:form prependId="true" id="form">
			<p:ajaxStatus onstart="statusDialog.show();" oncomplete="statusDialog.hide();"/>  
              
			<p:dialog modal="true"
					  widgetVar="statusDialog" 
					  header="Carregando..."   
			          position="center center"
			          draggable="false" 
			          closable="false">  
			    <p:graphicImage value="/imagens/ajax-loader.gif" />  
			</p:dialog>  
			
			<p:growl id="message" sticky="false" life="2000"/>
			
			<p:panel id="pnlPrincipal" header="Ambiente de Trabalho" style="position:absolute;left:50%;margin-left:-400px;top:10px;height:auto;width:800px;">
				<div>
					<p:graphicImage url="/imagens/inforse-site.jpg" width="100%"/>
				</div>				
				<p:separator />
				<div style="position:relative;top:5%;width:100%;">
					<h:outputLabel value="Seja bem vindo(a), " style="font-family:Times New Roman;color:black;font-size:16px;" />
					<h:outputText value="#{usuarioMB.usuario.nome}!" style="font-family:Times New Roman;color:black;font-weight:bold;font-size:16px;" />					
				</div>
				<p:separator />
				<p:menubar style="font-size:14px;">
					<p:menuitem value="Produção" url="#" icon="ui-icon menu producao" />
					<p:menuitem value="Adicionar Clientes" update=":formDlgCliente:dlgCliente" actionListener="#{clienteMB.prepararInserirCliente}" oncomplete="dlgCliente.show()" icon="ui-icon menu clientes"/>
					<p:menuitem value="Importar Clientes" url="#" icon="ui-icon menu importar"/>
					<p:menuitem value="Solicitar Orçamento" update=":form:message,:formDlgOrcamento:dlgOrcamento" actionListener="#{clienteMB.prepararSolicitarOrcamento}" icon="ui-icon menu orcamento"/>
					<p:menuitem value="Ranking" update=":formDlgRanking:tblOrcamentos,:form:message" actionListener="#{orcamentoMB.preencherListaOrcamentos}" oncomplete="dlgRanking.show()" icon="ui-icon menu ranking"/>
					<p:menuitem value="Sair" url="#" icon="ui-icon menu sair"/>
				</p:menubar>
				
				<p:separator />
				
				<p:dataTable style="font-size:14px;" 
			    			 id="tblClientes" 
			    			 var="cliente" 
			    			 widgetVar="cliente"			    			 
			    			 value="#{clienteMB.listaClientes}"
			    			 filteredValue="#{clienteMB.filtroClientes}"  
			                 paginatorPosition="bottom"
			                 emptyMessage="Nenhum cliente encontrado."
			                 selection="#{clienteMB.selectedCliente}"
			                 selectionMode="single"
			                 rowKey="#{cliente.codigo}"
			                 paginator="true" 
			                 rows="5"  
			                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
			                 rowsPerPageTemplate="5,10,15">  
			        <f:facet name="header">  
			  			<p:outputPanel>  
			                <h:outputText value="Clientes"/>			                  
			            </p:outputPanel>  
			  		</f:facet>
			  		
			        <p:column headerText="Código"
			        		  filterBy="#{cliente.codigo.id}"
			        		  filterMatchMode="exact">  
			        	<h:outputText value="#{cliente.codigo.id}" />
			        </p:column>  
			  
			        <p:column headerText="Razão Social"
			        		  filterBy="#{cliente.razaoSocial}"
			        		  filterMatchMode="startsWith">  
			            <h:outputText value="#{cliente.razaoSocial}" />
			        </p:column>  
			  
			        <p:column headerText="Endereço"
			        		  filterBy="#{cliente.logradouro},
			        		  			#{cliente.numero},
			        		  			#{cliente.bairro},
			        		  			#{cliente.cidade},
			        		  			#{cliente.uf},
			        		  			#{cliente.cep}"
			        		  filterMatchMode="contains">  
			            <div style="font-size:12px;">  
				            <h:outputText value="#{cliente.logradouro}" />
				            <h:outputText value=", " />
				            <h:outputText value="#{cliente.numero}" /><br/>
				            <h:outputText value="#{cliente.bairro}" /><br/>
				            <h:outputText value="#{cliente.cidade}" />
				            <h:outputText value="/" />
				            <h:outputText value="#{cliente.uf}" /><br/>
				            <h:outputText value="CEP: " />
				            <h:outputText value="#{cliente.cep}" />				            
				        </div>  
			        </p:column>
			        
			        <p:column headerText="Contatos"
			        		  filterBy="#{cliente.telefone},
			        		  			#{cliente.celular},
			        		  			#{cliente.email}"
			        		  filterMatchMode="contains">  
			            <div style="font-size:12px;">  
				            <h:outputText value="Tel.: "/>
				            <h:outputText value="#{cliente.telefone}" /><br/>
				            <h:outputText value="Cel.: " />
				            <h:outputText value="#{cliente.celular}" /><br/>
				            <h:outputText value="E-mail: " />
				            <h:outputText value="#{cliente.email}" />				            				            
				        </div>  
			        </p:column>
			        			        
			        <p:column >
			        	<center>
				        	<p:commandButton update=":formDlgEditarCliente:dlgEditarCliente" oncomplete="dlgEditarCliente.show()" image="editar" title="Editar Cliente">
				        		<f:setPropertyActionListener target="#{clienteMB.selectedCliente}" value="#{cliente}" />
				        	</p:commandButton> 
				        </center>
			        </p:column>    
			        <p:column>
			        	<center>
				        	<p:commandButton update=":formDlgExcluir:dlgExcluir" oncomplete="dlgExcluir.show()" image="excluir" title="Excluir Cliente">
				        		<f:setPropertyActionListener target="#{clienteMB.selectedCliente}" value="#{cliente}" />
				        	</p:commandButton>			        		 
				        </center>
			        </p:column>
			    </p:dataTable>
			    
			   	<span>
					<h:outputText style="position:relative;font-family:Times New Roman;font-size:14px;" value="#{usuarioMB.dataAtual}">
						<f:convertDateTime pattern="HH:mm - dd/MM/yyyy" timeZone="GMT-2"/>
					</h:outputText>
				</span>								
			</p:panel>
		</h:form>
		<h:form prependId="true" id="formDlgCliente">			
			<p:dialog showEffect="slide" 
					  hideEffect="slide" 
					  id="dlgCliente"
					  widgetVar="dlgCliente"
					  header="Cadastro de Clientes" 
					  modal="true" 
					  resizable="false" 
					  closable="false"
					  position="center center"
					  style="height:auto;width:auto;">
					<div style="font-size:14px;">
						<h:panelGrid columns="1">
							<h:outputLabel value="Razão Social" />
														
							<p:inputText id="razaoSocial" value="#{clienteMB.cliente.razaoSocial}" size="40" required="true" requiredMessage="Digite a razão social!" />						
						</h:panelGrid>
						
						<h:panelGrid columns="3">
							<h:outputLabel value="CNPJ" />
							<h:outputLabel value="Inscrição Estadual" />
							<h:outputLabel value="Unidade Consumidora" />
														
							<p:inputMask id="cnpj" value="#{clienteMB.cliente.cnpj}" size="18" maxlength="14" mask="99.999.999/9999-99" required="true" requiredMessage="Digite o CNPJ!" />
							<p:inputText id="inscricaoEstadual" value="#{clienteMB.cliente.inscricaoEstadual}" size="18" />
							<p:inputText id="unidadeConsumidora" value="#{clienteMB.cliente.unidadeConsumidora}" size="21" />
																				
							
						</h:panelGrid>
						
						<h:panelGrid columns="3">
							<h:outputLabel value="Contato" />
							<h:outputLabel value="Cargo" />
							<h:outputLabel value="Ramo de Atividade" />
							
							<p:inputText id="contato" value="#{clienteMB.cliente.contato}" size="25" />
							<p:inputText id="cargo" value="#{clienteMB.cliente.cargo}" size="16" />
							<p:inputText id="ramoAtividade" value="#{clienteMB.cliente.ramoAtividade}" size="16" />
						</h:panelGrid>
					
						<p:separator />												
						
						<h:panelGrid columns="4">
						
							<h:outputLabel value="Logradouro"/>
							<h:outputLabel value="Nº"/>
							<h:outputLabel value="Bairro"/>
							<h:outputLabel value="CEP" />
						
							<p:inputText id="logradouro" value="#{clienteMB.cliente.logradouro}" size="25" required="true" requiredMessage="Digite o logradouro!" />
							<p:inputText id="numero" value="#{clienteMB.cliente.numero}" size="5" maxlength="10" required="true" requiredMessage="Digite o número!" />
							<p:inputText id="bairro" value="#{clienteMB.cliente.bairro}" size="15" required="true" requiredMessage="Digite o bairro!" />
							<p:inputMask id="cep" value="#{clienteMB.cliente.cep}" mask="99999-999" size="9" maxlength="8" required="true" requiredMessage="Digite o cep!" />
						</h:panelGrid>
						
						<h:panelGrid columns="1">
							<h:outputLabel value="Cidade"/>							
							<p:inputText id="cidade" value="#{clienteMB.cliente.cidade}" size="39" required="true" requiredMessage="Digite a cidade!" style="margin-right:10%;"/>
						</h:panelGrid>
						
						<h:panelGrid columns="1">
							<h:outputLabel value="UF" />
							<p:selectOneMenu id="uf" value="#{clienteMB.cliente.uf}" required="true" requiredMessage="Selecione o estado!">
								<f:selectItem itemLabel="Selecione..." itemValue="" />
								<f:selectItem itemLabel="AC" itemValue="AC" />
								<f:selectItem itemLabel="AL" itemValue="AL" />
								<f:selectItem itemLabel="AM" itemValue="AM" />
								<f:selectItem itemLabel="AP" itemValue="AP" />
								<f:selectItem itemLabel="BA" itemValue="BA" />
								<f:selectItem itemLabel="CE" itemValue="CE" />
								<f:selectItem itemLabel="DF" itemValue="DF" />
								<f:selectItem itemLabel="ES" itemValue="ES" />
								<f:selectItem itemLabel="GO" itemValue="GO" />
								<f:selectItem itemLabel="MA" itemValue="MA" />
								<f:selectItem itemLabel="MG" itemValue="MG" />
								<f:selectItem itemLabel="MS" itemValue="MS" />
								<f:selectItem itemLabel="MT" itemValue="MT" />
								<f:selectItem itemLabel="PA" itemValue="PA" />
								<f:selectItem itemLabel="PB" itemValue="PB" />
								<f:selectItem itemLabel="PE" itemValue="PE" />
								<f:selectItem itemLabel="PI" itemValue="PI" />
								<f:selectItem itemLabel="PR" itemValue="PR" />
								<f:selectItem itemLabel="RJ" itemValue="RJ" />
								<f:selectItem itemLabel="RN" itemValue="RN" />
								<f:selectItem itemLabel="RO" itemValue="RO" />
								<f:selectItem itemLabel="RR" itemValue="RR" />
								<f:selectItem itemLabel="RS" itemValue="RS" />
								<f:selectItem itemLabel="SC" itemValue="SC" />
								<f:selectItem itemLabel="SE" itemValue="SE" />
								<f:selectItem itemLabel="SP" itemValue="SP" />
								<f:selectItem itemLabel="TO" itemValue="TO" />						
							</p:selectOneMenu>							
						</h:panelGrid>
												
						<p:separator />
						
						<h:panelGrid columns="3">
							<h:outputLabel value="Telefone" />
							<h:outputLabel value="Celular" />
							<h:outputLabel value="Email" />
						
							<p:inputMask id="telefone" value="#{clienteMB.cliente.telefone}" mask="(99)9999-9999" size="13" maxlength="10" />
							<p:inputMask id="celular" value="#{clienteMB.cliente.celular}" mask="(99)9999-9999" size="13" maxlength="10" />
							<p:inputMask id="email" value="#{clienteMB.cliente.email}" size="31" maxlength="50" />
						</h:panelGrid>
						
						<p:separator />
						
						<div>
							<p:commandButton update=":form:message,:form:tblClientes" image="confirmar" oncomplete="dlgCliente.hide();" value="Salvar" actionListener="#{clienteMB.inserirCliente}" />
							<p:commandButton image="cancelar" value="Cancelar" immediate="true" oncomplete="dlgCliente.hide()" />
						</div>					
					</div>
			</p:dialog>
		</h:form>
	
	
		<h:form prependId="true" id="formDlgEditarCliente">	
			<p:dialog showEffect="slide" 
				  hideEffect="slide" 
				  id="dlgEditarCliente" 
				  widgetVar="dlgEditarCliente"
				  header="Cadastro de Clientes" 
				  modal="true" 
				  resizable="false" 
				  closable="false"
				  position="center center"
				  style="height:auto;width:auto;">
				<div style="font-size:14px;">
					<h:panelGrid columns="1">
						<h:outputLabel value="Razão Social" />
						<p:inputText id="razaoSocialEditar" value="#{clienteMB.selectedCliente.razaoSocial}" size="39" required="true" requiredMessage="Digite a razão social!" />
					</h:panelGrid>
					
					<h:panelGrid columns="3">
							<h:outputLabel value="CNPJ" />
							<h:outputLabel value="Inscrição Estadual" />
							<h:outputLabel value="Unidade Consumidora" />
														
							<p:inputMask id="cnpj" value="#{clienteMB.selectedCliente.cnpj}" size="18" maxlength="14" mask="99.999.999/9999-99" required="true" requiredMessage="Digite o CNPJ!" />
							<p:inputText id="inscricaoEstadual" value="#{clienteMB.selectedCliente.inscricaoEstadual}" size="18" />
							<p:inputText id="unidadeConsumidora" value="#{clienteMB.selectedCliente.unidadeConsumidora}" size="21" />
																				
							
						</h:panelGrid>
						
						<h:panelGrid columns="3">
							<h:outputLabel value="Contato" />
							<h:outputLabel value="Cargo" />
							<h:outputLabel value="Ramo de Atividade" />
							
							<p:inputText id="contato" value="#{clienteMB.selectedCliente.contato}" size="25" />
							<p:inputText id="cargo" value="#{clienteMB.selectedCliente.cargo}" size="16" />
							<p:inputText id="ramoAtividade" value="#{clienteMB.selectedCliente.ramoAtividade}" size="16" />
						</h:panelGrid>
					
					<p:separator />												
					
					<h:panelGrid columns="4">
						<h:outputLabel value="Logradouro"/>
						<h:outputLabel value="Nº"/>
						<h:outputLabel value="Bairro"/>
						<h:outputLabel value="CEP" />
					
						<p:inputText id="logradouroEditar" value="#{clienteMB.selectedCliente.logradouro}" size="25" required="true" requiredMessage="Digite o logradouro!" />
						<p:inputText id="numeroEditar" value="#{clienteMB.selectedCliente.numero}" size="5" maxlength="10" required="true" requiredMessage="Digite o número!" />
						<p:inputText id="bairroEditar" value="#{clienteMB.selectedCliente.bairro}" size="15" required="true" requiredMessage="Digite o bairro!" />
						<p:inputMask id="cepEditar" value="#{clienteMB.selectedCliente.cep}" mask="99999-999" size="9" maxlength="8" required="true" requiredMessage="Digite o cep!" />
					</h:panelGrid>
					
					<h:panelGrid columns="1">
						<h:outputLabel value="Cidade" />							
						<p:inputText id="cidadeEditar" value="#{clienteMB.selectedCliente.cidade}" size="39" required="true" requiredMessage="Digite a cidade!" />
					</h:panelGrid>
					
					<h:panelGrid columns="1">
						<h:outputLabel value="UF" />
						<p:selectOneMenu id="ufEditar" value="#{clienteMB.selectedCliente.uf}" rendered="#{not empty clienteMB.selectedCliente.uf}" required="true" requiredMessage="Selecione o estado!" >
							<f:selectItem itemLabel="Selecione..." itemValue="" />
							<f:selectItem itemLabel="AC" itemValue="AC" />
							<f:selectItem itemLabel="AL" itemValue="AL" />
							<f:selectItem itemLabel="AM" itemValue="AM" />
							<f:selectItem itemLabel="AP" itemValue="AP" />
							<f:selectItem itemLabel="BA" itemValue="BA" />
							<f:selectItem itemLabel="CE" itemValue="CE" />
							<f:selectItem itemLabel="DF" itemValue="DF" />
							<f:selectItem itemLabel="ES" itemValue="ES" />
							<f:selectItem itemLabel="GO" itemValue="GO" />
							<f:selectItem itemLabel="MA" itemValue="MA" />
							<f:selectItem itemLabel="MG" itemValue="MG" />
							<f:selectItem itemLabel="MS" itemValue="MS" />
							<f:selectItem itemLabel="MT" itemValue="MT" />
							<f:selectItem itemLabel="PA" itemValue="PA" />
							<f:selectItem itemLabel="PB" itemValue="PB" />
							<f:selectItem itemLabel="PE" itemValue="PE" />
							<f:selectItem itemLabel="PI" itemValue="PI" />
							<f:selectItem itemLabel="PR" itemValue="PR" />
							<f:selectItem itemLabel="RJ" itemValue="RJ" />
							<f:selectItem itemLabel="RN" itemValue="RN" />
							<f:selectItem itemLabel="RO" itemValue="RO" />
							<f:selectItem itemLabel="RR" itemValue="RR" />
							<f:selectItem itemLabel="RS" itemValue="RS" />
							<f:selectItem itemLabel="SC" itemValue="SC" />
							<f:selectItem itemLabel="SE" itemValue="SE" />
							<f:selectItem itemLabel="SP" itemValue="SP" />
							<f:selectItem itemLabel="TO" itemValue="TO" />						
						</p:selectOneMenu>							
					</h:panelGrid>
											
					<p:separator />
					
					<h:panelGrid columns="3">
						<h:outputLabel value="Telefone" />
						<h:outputLabel value="Celular" />
						<h:outputLabel value="Email" />
					
						<p:inputMask id="telefoneEditar" value="#{clienteMB.selectedCliente.telefone}" mask="(99)9999-9999" size="13" maxlength="10" />
						<p:inputMask id="celularEditar" value="#{clienteMB.selectedCliente.celular}" mask="(99)9999-9999" size="13" maxlength="10" />
						<p:inputMask id="emailEditar" value="#{clienteMB.selectedCliente.email}" size="31" maxlength="50" />
					</h:panelGrid>
					
					<p:separator />
					
					<div>
						<p:commandButton update=":form:message,:form:tblClientes" image="confirmar" oncomplete="dlgEditarCliente.hide();" value="Salvar" actionListener="#{clienteMB.atualizarCliente}" />
						<p:commandButton image="cancelar" value="Cancelar" immediate="true" oncomplete="dlgEditarCliente.hide()" />
					</div>
				</div>
			</p:dialog>
		</h:form>
		
		<h:form prependId="true" id="formDlgRanking">	
			<p:dialog showEffect="slide" 
				  hideEffect="slide" 
				  id="dlgRanking" 
				  widgetVar="dlgRanking"
				  header="Ranking" 
				  modal="true" 
				  resizable="false" 
				  closable="false"
				  position="center center"
				  style="height:auto">
				<div style="font-size:14px;">
					<p:dataTable style="font-size:14px;" 
			    			 id="tblOrcamentos" 
			    			 var="orcamento" 
			    			 widgetVar="orcamento"			    			 
			    			 value="#{orcamentoMB.listaOrcamentos}"  
			                 paginatorPosition="bottom"
			                 emptyMessage="Nenhum orçamento encontrado."
			                 selection="#{orcamentoMB.selectedOrcamento}"
			                 selectionMode="single"
			                 rowKey="#{orcamento.id}"
			                 paginator="true" 
			                 rows="5"  
			                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
			                 rowsPerPageTemplate="5,10,15">  
				        <f:facet name="header">  
				  			<p:outputPanel>  
				                <h:outputText value="Orçamentos" />			                  
				            </p:outputPanel>  
				  		</f:facet>
				  		
				        <p:column headerText="Orçamento">				        		    
				        	<h:outputText value="#{orcamento.id.id}" />
				        </p:column>  
				  
				        <p:column headerText="Cliente">  
				            <h:outputText value="#{orcamento.cliente.razaoSocial}" />
				        </p:column>  
				  
				        <p:column headerText="Data Emissão">  
				            <h:outputText value="#{orcamento.dataEmissao}" >
				            	<f:convertDateTime pattern="dd/MM/yyyy - HH:mm:ss" timeZone="GMT-3"/>
				            </h:outputText>					          
				        </p:column>
				        
				        <p:column headerText="Usuário Emissão">  
				            <h:outputText value="#{orcamento.usuarioEmissao}" />  
				        </p:column>
				        
				        <p:column >
			        		<center>
				        		<p:commandButton update=":formDlgCalcularOrcamento:dlgCalcularOrcamentoCustoFixo, :formDlgCalcularOrcamento:dlgCalcularOrcamentoCustoOperacional, :formDlgCalcularOrcamento:dlgCalcularOrcamentoTotalOrcamental" action="#{orcamentoMB.prepararInserirCustoFixo}" oncomplete="dlgCalcularOrcamentoCustoFixo.show();" image="calcularOrcamento" title="Calcular Orcamento">
				        			<f:setPropertyActionListener target="#{orcamentoMB.selectedOrcamento}" value="#{orcamento}" />
				        		</p:commandButton> 
				        	</center>
			        	</p:column> 
				        			        
				        <p:column style="#{orcamento.corStatus}" headerText="Status">  
				            <h:outputText value="#{orcamento.status}" />  
				        </p:column>				        
				    </p:dataTable>
				    
				    <p:separator />
					
					<div>
						<p:commandButton image="voltar" value="Voltar" onclick="dlgRanking.hide()" />
						<p:commandButton image="gerarOrcamento" update=":form:message" oncomplete="handleComplete(xhr, status, args)" value="Gerar Orçamento" actionListener="#{orcamentoMB.prepararGerarOrcamento}" />						
						<p:commandButton ajax="false" id="btnGerarOrcamento" widgetVar="btnGerarOrcamento" onclick="this.form.target='_blank'" actionListener="#{orcamentoMB.gerarOrcamento}" style="display:none"/>
					</div>	
				</div>				
			</p:dialog>
		</h:form>
		
		<h:form prependId="true" id="formDlgCalcularOrcamento">	
			<p:dialog showEffect="slide" 
				  hideEffect="slide" 
				  id="dlgCalcularOrcamentoCustoFixo" 
				  widgetVar="dlgCalcularOrcamentoCustoFixo"
				  header="Calcular Orçamento" 
				  modal="true" 
				  resizable="false" 
				  closable="false"
				  position="center center"
				  style="height:auto">
				<div style="font-size:14px;">
					<h:panelGrid columns="2">					
						<p:panelGrid columns="4">  
						    <f:facet name="header">  
						        Custo Mensal Fixo  
						    </f:facet>  
						  
						    <h:outputLabel for="prolabore" value="Pró-Labore" />  
						    <pe:inputNumber id="prolabore" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.proLabore}" style="background-color:#FFFF00" size="15">
						    	<p:ajax event="blur" update="encargosProLabore, totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularEncargosProLabore}" />
						    </pe:inputNumber>  
						   
						    <h:outputLabel for="encargosProLabore" value="Encargos sobre o Pró-Labore" />  
						    <pe:inputNumber id="encargosProLabore" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.encargosProLabore}" readonly="true" style="background-color:#EEE9E9" size="15"/>
						    
						    <h:outputLabel for="salarioAdministrativo" value="Salário Administrativo" />  
						    <pe:inputNumber id="salarioAdministrativo" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.salarioAdministrativo}" required="true" tabindex="2" requiredMessage="Necessário preencher o Salário Administrativo!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="encargosSociaisProLabore, totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularEncargosSociaisProLabore}" />
						    </pe:inputNumber>  
						   
						    <h:outputLabel for="encargosSociaisProLabore" value="Enc. Sociais sobre o Pró-Labore (25%)" />  
						    <pe:inputNumber id="encargosSociaisProLabore" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.encargosSociaisProLabore}" readonly="true" style="background-color:#EEE9E9" size="15"/>
						    
						    <h:outputLabel for="seguros" value="Seguros" />  
						    <pe:inputNumber id="seguros" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.seguros}" required="true" tabindex="3" requiredMessage="Necessário preencher os Seguros!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularCustoTotalCustoHora}" />
						    </pe:inputNumber>  
						   
						    <h:outputLabel for="despesasBancarias" value="Despesas Bancárias" />  
						    <pe:inputNumber id="despesasBancarias" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.despesasBancarias}" required="true" tabindex="4" requiredMessage="Necessário preencher as Despesas Bancárias!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularCustoTotalCustoHora}" />
						    </pe:inputNumber>
						    
						    <h:outputLabel for="juros" value="Juros" />  
						    <pe:inputNumber id="juros" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.juros}" required="true" tabindex="5" requiredMessage="Necessário preencher os Juros!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularCustoTotalCustoHora}" />
						    </pe:inputNumber>  
						   
						    <h:outputLabel for="honorariosContabeis" value="Honorários Contábeis" />  
						    <pe:inputNumber id="honorariosContabeis" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.honorariosContabeis}" required="true" tabindex="6" requiredMessage="Necessário preencher os Honorários Contábeis!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularCustoTotalCustoHora}" />
						    </pe:inputNumber>
						    
						    <h:outputLabel for="materialExpediente" value="Material de Expediente" />  
						    <pe:inputNumber id="materialExpediente" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.materialExpediente}" required="true" tabindex="7" requiredMessage="Necessário preencher o Material de Expediente!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularCustoTotalCustoHora}" />
						    </pe:inputNumber>
						   
						    <h:outputLabel for="aluguel" value="Aluguel" />  
						    <pe:inputNumber id="aluguel" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.aluguel}" required="true" tabindex="8" requiredMessage="Necessário preencher o Aluguel!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularCustoTotalCustoHora}" />
						    </pe:inputNumber>
						    
						    <h:outputLabel for="despesaViagens" value="Despesa com Viagens" />  
						    <pe:inputNumber id="despesaViagens" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.despesaViagens}" required="true" tabindex="9" requiredMessage="Necessário preencher a Despesa com Viagens!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularCustoTotalCustoHora}" />
						    </pe:inputNumber>  
						   
						    <h:outputLabel for="agua" value="Água" />  
						    <pe:inputNumber id="agua" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.agua}" required="true" tabindex="10" requiredMessage="Necessário preencher a Água!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularCustoTotalCustoHora}" />
						    </pe:inputNumber>
							
							<h:outputLabel for="luz" value="Luz" />  
						    <pe:inputNumber id="luz" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.luz}" required="true" tabindex="11" requiredMessage="Necessário preencher a Luz!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularCustoTotalCustoHora}" />
						    </pe:inputNumber>
													  
							<h:outputLabel for="telefone" value="Telefone" />  
						    <pe:inputNumber id="telefone" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.telefone}" required="true" tabindex="12" requiredMessage="Necessário preencher o Telefone!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularCustoTotalCustoHora}" />
						    </pe:inputNumber>
							
							<h:outputLabel for="publicidade" value="Publicidade" />  
						    <pe:inputNumber id="publicidade" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.publicidade}" required="true" tabindex="13" requiredMessage="Necessário preencher a Publicidade!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularCustoTotalCustoHora}" />
						    </pe:inputNumber>
						    
						    <h:outputLabel for="transporte" value="Serviços Internet" />  
						    <pe:inputNumber id="transporte" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.servicosInternet}" required="true" tabindex="14" requiredMessage="Necessário preencher o campo Serviços Internet!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularCustoTotalCustoHora}" />
						    </pe:inputNumber>
						    
						    <h:outputLabel for="manutencaoVeicular" value="Manutenção Veicular" />  
						    <pe:inputNumber id="manutencaoVeicular" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.manutencaoVeicular}" required="true" tabindex="15" requiredMessage="Necessário preencher a Manutenção Veicular!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularCustoTotalCustoHora}" />
						    </pe:inputNumber>
						    
						    <h:outputLabel for="transporteFuncionarios" value="Outros" />  
						    <pe:inputNumber id="transporteFuncionarios" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.outros}" required="true" tabindex="16" requiredMessage="Necessário preencher o campo Outros!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularCustoTotalCustoHora}" />
						    </pe:inputNumber>
						    
						    <h:outputLabel for="pertinentesVariados" value="Pertinentes Variados" />  
						    <pe:inputNumber id="pertinentesVariados" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.pertinentesVariados}" required="true" tabindex="17" requiredMessage="Necessário preencher os Pertinentes Variados!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularCustoTotalCustoHora}" />
						    </pe:inputNumber>
													  
						    <f:facet name="footer">  
						    	<h:outputLabel for="qtdHorasMes" value="Qtd. Horas/Mês" />
						    	<pe:inputNumber id="qtdHorasMes" decimalPlaces="0" roundMethod="S" decimalSeparator="," thousandSeparator="." value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoFixo.qtdHorasMes}" required="true" tabindex="18" requiredMessage="Necessário preencher a Quantidade de Horas/Mês!" size="10" style="margin-left:5px;background-color:#FFFF00">
						    		<p:ajax event="blur" update="totalCusto, valorCustoHora" listener="#{orcamentoMB.calcularCustoTotalCustoHora}" />
						    	</pe:inputNumber>
						    	<h:outputLabel for="totalCusto" value="Total Custo" style="margin-left:10px;"/>
						    	<pe:inputNumber id="totalCusto" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.totalCusto}" readonly="true" style="margin-left:5px;background-color:#FF0000;font-weight:bold;color:#FFFFFF" size="15"/>
						    	<h:outputLabel for="valorCustoHora" value="Valor Custo/Hora" style="margin-left:10px;" />
						    	<pe:inputNumber id="valorCustoHora" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.valorCustoHora}" readonly="true" style="margin-left:5px;background-color:#FF0000;font-weight:bold;color:#FFFFFF;" size="15"/>
						    </f:facet>  
						</p:panelGrid>										
					</h:panelGrid>
					
					<p:separator />
						
					<div>
						<p:commandButton image="voltar" value="Voltar" immediate="true" onclick="dlgCalcularOrcamentoCustoFixo.hide()" />
					    <p:commandButton image="avancar2" value="Avançar" update=":form:message, tblCustoProfissionais" actionListener="#{orcamentoMB.inserirCustoFixo}" oncomplete="dlgCalcularOrcamentoCustoProfissionais.show();"/>
					    	
					</div>
										
				</div>				
			</p:dialog>
			
			<p:dialog showEffect="slide" 
				  hideEffect="slide" 
				  id="dlgCalcularOrcamentoCustoProfissionais" 
				  widgetVar="dlgCalcularOrcamentoCustoProfissionais"
				  header="Calcular Orçamento" 
				  modal="true"
				  resizable="false" 
				  closable="false"
				  position="center center"
				  style="height:auto">
				<div style="font-size:14px;">								
					<h:panelGrid id="pnlGridProfissional" columns="7">
						<h:outputLabel value="Profissão" />
						<h:outputLabel value="Qtd." />
						<h:outputLabel value="Salário" />
						<h:outputLabel value="Encargos(%)" />
						<h:outputLabel value="Horas no Mês" />
						<h:outputLabel value="Horas Realizadas" />
						<h:outputLabel value="" />
											
						<p:inputText id="profissao" value="#{orcamentoMB.custoProfissionais.profissao}" size="50" style="background-color:#FFFF00"/>
						<pe:inputNumber id="qtdProfissionais" decimalPlaces="0" value="#{orcamentoMB.custoProfissionais.qtdProfissionais}" size="3" style="background-color:#FFFF00"/>
						<pe:inputNumber id="salario" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.custoProfissionais.salario}" size="15" style="background-color:#FFFF00"/>
						<pe:inputNumber id="encargos" decimalPlaces="2" decimalSeparator="," thousandSeparator="." value="#{orcamentoMB.custoProfissionais.encargos}" size="10" style="background-color:#FFFF00"/>
						<pe:inputNumber id="horasMes" decimalPlaces="0" roundMethod="S" value="#{orcamentoMB.custoProfissionais.horasMes}" size="15" style="background-color:#FFFF00"/>
						<pe:inputNumber id="horasRealizadas" decimalPlaces="0" roundMethod="S" value="#{orcamentoMB.custoProfissionais.horasRealizadas}" size="15" style="background-color:#FFFF00"/>
						<p:commandButton actionListener="#{orcamentoMB.inserirProfissional}" update="pnlGridProfissional,tblCustoProfissionais" image="adicionar" title="Adicionar Profissional" />					
					</h:panelGrid>
					
					<div style="font-size:14px;">
						<p:dataTable style="font-size:14px;" 
				    			 id="tblCustoProfissionais" 
				    			 var="custoProfissionais" 
				    			 widgetVar="custoProfissionais"			    			 
				    			 value="#{orcamentoMB.listaProfissionais}"
				    			 paginatorPosition="bottom"
				                 emptyMessage="Nenhum profissional encontrado."
				                 selection="#{orcamentoMB.selectedCustoProfissionais}"
				                 selectionMode="single"
				                 rowKey="#{custoProfissionais.id}"
				                 paginator="true" 
				                 rows="5"  
				                 paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
				                 rowsPerPageTemplate="5,10,15">  
					        <f:facet name="header">  
					  			<p:outputPanel>  
					                <h:outputText value="Custo de Profissionais" />			                  
					            </p:outputPanel>  
					  		</f:facet>
					  		
					        <p:column headerText="Profissão">				        		    
					        	<h:outputText value="#{custoProfissionais.profissao}" />
					        </p:column>  
					  
					        <p:column headerText="Qtd">
					        	<center>  
					            	<h:outputText value="#{custoProfissionais.qtdProfissionais}">
					        			<f:convertNumber minFractionDigits="0" maxFractionDigits="0"/>    	
					            	</h:outputText>
					            </center>
					        </p:column>  
					  
					        <p:column headerText="Salário">
					        	<center>  
						            <h:outputText value="#{custoProfissionais.salario}">
						            	<f:convertNumber minFractionDigits="2" maxFractionDigits="2" pattern="R$ #,##0.00"/>
						            </h:outputText>					            						          
						        </center>
					        </p:column>
					        
					        <p:column headerText="Encargos(%)">
					        	<center>  
						            <h:outputText value="#{custoProfissionais.encargos}">
						            	<f:convertNumber minFractionDigits="0" maxFractionDigits="2"/>
						            </h:outputText>  
						        </center>
					        </p:column>
					        
					        <p:column headerText="Salário + Encargos">  
					            <center>
						            <h:outputText value="#{custoProfissionais.salariosEncargos}">
						            	<f:convertNumber minFractionDigits="2" maxFractionDigits="2" pattern="R$ #,##0.00"/>
						            </h:outputText>
						        </center>  
					        </p:column>
					        
					        <p:column headerText="Horas no Mês">  
						    	<center>
						            <h:outputText value="#{custoProfissionais.horasMes}">
						            	<f:convertNumber minFractionDigits="0" maxFractionDigits="0"/>
						            </h:outputText>
						        </center>  
					        </p:column>
					        
					        <p:column headerText="Custo/Hora">
					        	<center>  
						            <h:outputText value="#{custoProfissionais.custoHora}">
						            	<f:convertNumber minFractionDigits="2" maxFractionDigits="2" pattern="R$ #,##0.00"/>
						            </h:outputText>
						        </center>  
					        </p:column>
					        
					        <p:column headerText="Horas Realizadas">  
					            <center>
						            <h:outputText value="#{custoProfissionais.horasRealizadas}">
						            	<f:convertNumber minFractionDigits="0" maxFractionDigits="0"/>
						            </h:outputText>
						        </center>  
					        </p:column>
					        
					        <p:column headerText="Custo Médio" style="background-color:#FF0000;">  
					            <center>
						            <h:outputText value="#{custoProfissionais.custoMedio}" style="font-weight:bold;color:#FFFFFF;">
						            	<f:convertNumber minFractionDigits="2" maxFractionDigits="2" pattern="R$ #,##0.00"/>
						            </h:outputText>
						        </center>  
					        </p:column>
					        
					        <p:column >
				        		<center>
					        		<p:commandButton oncomplete="dlgExcluirProfissional.show()" image="deletar" title="Excluir Profissional">
					        			<f:setPropertyActionListener target="#{orcamentoMB.selectedCustoProfissionais}" value="#{custoProfissionais}" />
					        		</p:commandButton> 
					        	</center>
				        	</p:column>			        				        
					    </p:dataTable>
				  	</div>
					
					<p:separator />
						
					<div>
						<p:commandButton image="voltar" value="Voltar" immediate="true" onclick="dlgCalcularOrcamentoCustoProfissionais.hide()" />
					    <p:commandButton image="avancar2" value="Avançar" update="dlgCalcularOrcamentoCustoOperacional" actionListener="#{orcamentoMB.prepararInserirCustoOperacional}" oncomplete="dlgCalcularOrcamentoCustoOperacional.show();" />
					</div>
										
				</div>				
			</p:dialog>
			
			<p:dialog showEffect="slide" 
				  hideEffect="slide" 
				  id="dlgCalcularOrcamentoCustoOperacional" 
				  widgetVar="dlgCalcularOrcamentoCustoOperacional"
				  header="Calcular Orçamento" 
				  modal="true" 
				  resizable="false"
				  closable="false"
				  position="center center"
				  style="height:auto">
				<div style="font-size:14px;">
					<center>
					<p:panelGrid columns="8">  
					    <f:facet name="header">  
					        Despesa com Carro  
					    </f:facet>
					    						   
					    <h:outputLabel for="kmRodados" value="Km Rodados" />  
					    <pe:inputNumber id="kmRodados" decimalPlaces="0" roundMethod="S" value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoOperacional.kmRodados}" required="true" tabindex="1" requiredMessage="Necessário preencher a distância percorrida!" size="10" style="background-color:#FFFF00">
					    	<p:ajax event="blur" update="totalGasto, consumoLitro, depreciacaoVeicular, totalCustoOperacional" listener="#{orcamentoMB.prepararInserirCustoOperacional}"/>
					    </pe:inputNumber>	
					    <h:outputLabel for="kmLitro" value="Km/Litro" />  
					    <pe:inputNumber id="kmLitro" decimalPlaces="0" roundMethod="S" value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoOperacional.kmLitro}" required="true" tabindex="2" requiredMessage="Necessário preencher o consumo!" size="10" style="background-color:#FFFF00">
					    	<p:ajax event="blur" update="totalGasto, consumoLitro, totalCustoOperacional" listener="#{orcamentoMB.prepararInserirCustoOperacional}"/>
					    </pe:inputNumber>
					    	
					    <h:outputLabel for="valorLitro" value="Valor por Litro" />  
					    <pe:inputNumber id="valorLitro" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoOperacional.valorLitro}" required="true" tabindex="3" requiredMessage="Necessário preencher o valor por litro!" size="10" style="background-color:#FFFF00">
					    	<p:ajax event="blur" update="totalGasto, consumoLitro, totalCustoOperacional" listener="#{orcamentoMB.prepararInserirCustoOperacional}"/>
					    </pe:inputNumber>
					    	
					    <h:outputLabel for="valorDepreciacao" value="Valor Depreciação" />  
					    <pe:inputNumber id="valorDepreciacao" decimalPlaces="2" roundMethod="S" decimalSeparator="," thousandSeparator="." value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoOperacional.valorDepreciacao}" required="true" tabindex="4" requiredMessage="Necessário preencher o valor da depreciação!" size="10" style="background-color:#FFFF00">
					    	<p:ajax event="blur" update="depreciacaoVeicular, totalCustoOperacional" listener="#{orcamentoMB.prepararInserirCustoOperacional}" />
					    </pe:inputNumber>						    
					    						    
					    <f:facet name="footer">  
					    	<h:outputLabel for="totalGasto" value="Total de Gasto" />  
						    <pe:inputNumber id="totalGasto" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.totalGasto}" readonly="true" style="margin-left:5px;background-color:#EEE9E9" size="10" />
						    
						    <h:outputLabel for="consumoLitro" value="Consumo de Litro" />  
						    <pe:inputNumber id="consumoLitro" decimalPlaces="2" decimalSeparator="," roundMethod="S" thousandSeparator="." value="#{orcamentoMB.consumoLitro}" readonly="true" style="margin-left:5px;background-color:#EEE9E9" size="10" />
						    
						    <h:outputLabel for="depreciacaoVeicular" value="Depreciação Veicular" />  
						    <pe:inputNumber id="depreciacaoVeicular" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.depreciacaoVeicular}" readonly="true" style="margin-left:5px;background-color:#EEE9E9" size="10" />
					    </f:facet>  
					</p:panelGrid>
					
					<p:spacer height="20" />
					
					<center>
						<p:panelGrid columns="6">  
						    <f:facet name="header">  
						        Alimentação  
						    </f:facet>
						    						   
						    <h:outputLabel for="diasAlimentacao" value="Dias" />  
						    <pe:inputNumber id="diasAlimentacao" decimalPlaces="0" roundMethod="S" value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoOperacional.diasAlimentacao}" required="true" tabindex="5" requiredMessage="Necessário preencher os dias!" size="10" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalAlimentacao, totalCustoOperacional" listener="#{orcamentoMB.prepararInserirCustoOperacional}"/>
						    </pe:inputNumber>	
						    <h:outputLabel for="valorRefeicao" value="Valor da Refeição" />  
						    <pe:inputNumber id="valorRefeicao" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoOperacional.valorRefeicao}" required="true" tabindex="6" requiredMessage="Necessário preencher o consumo!" size="10" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalAlimentacao, totalCustoOperacional" listener="#{orcamentoMB.prepararInserirCustoOperacional}"/>
						    </pe:inputNumber>
						    	
						    <h:outputLabel for="qtdRefeicoes" value="Qtd. de Refeições" />  
						    <pe:inputNumber id="qtdRefeicoes" decimalPlaces="0" roundMethod="S" value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoOperacional.qtdRefeicoes}" required="true" tabindex="7" requiredMessage="Necessário preencher o valor por litro!" size="10" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalAlimentacao, totalCustoOperacional" listener="#{orcamentoMB.prepararInserirCustoOperacional}"/>
						    </pe:inputNumber>
						    					    						    
						    <f:facet name="footer">
						    	<h:outputLabel for="qtdTotalProfissionais" value="Qtd. de Profissionais" />  
							    <pe:inputNumber id="qtdTotalProfissionais" decimalPlaces="0" roundMethod="S" value="#{orcamentoMB.qtdTotalProfissionais}" readonly="true" style="margin-left:5px;background-color:#EEE9E9" size="10" />
						      
						    	<h:outputLabel for="totalAlimentacao" value="Total com Alimentação" />  
							    <pe:inputNumber id="totalAlimentacao" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.totalAlimentacao}" readonly="true" style="margin-left:5px;background-color:#EEE9E9" size="10" />						    
							</f:facet>  
						</p:panelGrid>										
					</center>
					
					<p:spacer height="20" />
					
					<h:panelGrid columns="2">
						<p:panelGrid columns="4">  
						    <f:facet name="header">  
						        Acomodação  
						    </f:facet>
						    						   
						    <h:outputLabel for="diasAcomodacao" value="Dias" />  
						    <pe:inputNumber id="diasAcomodacao" decimalPlaces="0" roundMethod="S" value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoOperacional.diasAcomodacao}" required="true" tabindex="8" requiredMessage="Necessário preencher os dias!" size="10" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalAcomodacao, totalCustoOperacional" listener="#{orcamentoMB.prepararInserirCustoOperacional}"/>
						    </pe:inputNumber>
						    <h:outputLabel for="valorAcomodacao" value="Valor da Acomodação" />  
						    <pe:inputNumber id="valorAcomodacao" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoOperacional.valorAcomodacao}" required="true" tabindex="9" requiredMessage="Necessário preencher o valor da acomodação!" size="10" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalAcomodacao, totalCustoOperacional" listener="#{orcamentoMB.prepararInserirCustoOperacional}"/>
						    </pe:inputNumber>
						    	
						    <f:facet name="footer">
						    	<h:outputLabel for="qtdTotalProfissionaisAcomodacao" value="Qtd. de Profissionais" />  
							    <pe:inputNumber id="qtdTotalProfissionaisAcomodacao" decimalPlaces="0" roundMethod="S" value="#{orcamentoMB.qtdTotalProfissionais}" readonly="true" style="margin-left:5px;background-color:#EEE9E9" size="10" />
						      
						    	<h:outputLabel for="totalAcomodacao" value="Total com Acomodação" />  
							    <pe:inputNumber id="totalAcomodacao" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.totalAcomodacao}" readonly="true" style="margin-left:5px;background-color:#EEE9E9" size="10" />						    
							</f:facet>  
						</p:panelGrid>
						
						<p:panelGrid columns="4">  
						    <f:facet name="header">  
						        Aluguel Carro  
						    </f:facet>
						    						   
						    <h:outputLabel for="qtdDiasAluguelCarro" value="Dias" />  
						    <pe:inputNumber id="qtdDiasAluguelCarro" decimalPlaces="0" roundMethod="S" value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoOperacional.qtdDiasAluguelCarro}" required="true" tabindex="10" requiredMessage="Necessário preencher a quantidade de dias de aluguel do carro!" size="10" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalAluguelCarro, totalCustoOperacional" listener="#{orcamentoMB.prepararInserirCustoOperacional}"/>
						    </pe:inputNumber>	
						    <h:outputLabel for="valorAluguelCarro" value="Valor do Aluguel do Carro" />  
						    <pe:inputNumber id="valorAluguelCarro" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoOperacional.valorAluguelCarro}" required="true" tabindex="11" requiredMessage="Necessário preencher o valor do alguel do carro!" size="10" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalAluguelCarro, totalCustoOperacional" listener="#{orcamentoMB.prepararInserirCustoOperacional}"/>
						    </pe:inputNumber>
						    	
						    <f:facet name="footer">
						    	<h:outputLabel for="totalAluguelCarro" value="Total Aluguel Carro" />  
							    <pe:inputNumber id="totalAluguelCarro" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.totalAluguelCarro}" readonly="true" style="margin-left:5px;background-color:#EEE9E9" size="10" />						      						    
							</f:facet>  
						</p:panelGrid>																
					</h:panelGrid>
					
					<p:spacer height="20" />
					
					<h:panelGrid columns="2">
						<p:panelGrid columns="4">  
						    <f:facet name="header">  
						        Transporte Aéreo  
						    </f:facet>
						    						   
						    <h:outputLabel for="qtdPassagem" value="Qtd. Passagem" />  
						    <pe:inputNumber id="qtdPassagem" decimalPlaces="0" roundMethod="S" value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoOperacional.qtdPassagem}" required="true" tabindex="10" requiredMessage="Necessário preencher a quantidade de passagens!" size="10" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalTransporteAereo, totalCustoOperacional" listener="#{orcamentoMB.prepararInserirCustoOperacional}"/>
						    </pe:inputNumber>
						    <h:outputLabel for="valorPassagem" value="Valor da Passagem" />  
						    <pe:inputNumber id="valorPassagem" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoOperacional.valorPassagem}" required="true" tabindex="11" requiredMessage="Necessário preencher o valor da passagem!" size="10" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalTransporteAereo, totalCustoOperacional" listener="#{orcamentoMB.prepararInserirCustoOperacional}"/>
						    </pe:inputNumber>
						    	
						    <f:facet name="footer">
						    	<h:outputLabel for="totalTransporteAereo" value="Total Transporte Aéreo" />  
							    <pe:inputNumber id="totalTransporteAereo" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.totalTransporteAereo}" readonly="true" style="margin-left:5px;background-color:#EEE9E9" size="10" />						      						    
							</f:facet>  
						</p:panelGrid>					
					
						<p:panelGrid columns="4">  
						    <f:facet name="header">  
						        Outros  
						    </f:facet>
						    						   
						    <h:outputLabel for="pedagio" value="Pedágio" />  
						    <pe:inputNumber id="pedagio" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoOperacional.pedagio}" required="true" tabindex="12" requiredMessage="Necessário preencher a quantidade de pedágios!" size="10" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalCustoOperacional" listener="#{orcamentoMB.calcularTotalCustoOperacional}"/>
						    </pe:inputNumber>
						    <h:outputLabel for="pertinentes" value="Pertinentes" />  
						    <pe:inputNumber id="pertinentes" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.custoOperacional.pertinentes}" required="true" tabindex="13" requiredMessage="Necessário preencher os pertinentes!" size="10" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="totalCustoOperacional" listener="#{orcamentoMB.calcularTotalCustoOperacional}"/>
						    </pe:inputNumber>
						    	
						    <f:facet name="footer">
						    	<h:outputLabel for="totalCustoOperacional" value="Total Custo Operacional" />  
							    <pe:inputNumber id="totalCustoOperacional" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.totalCustoOperacional}" readonly="true" style="margin-left:5px;background-color:#FF0000;font-weight:bold;color:#FFFFFF;" size="10" />						      						    
							</f:facet>  
						</p:panelGrid>										
					</h:panelGrid>
					</center>			
					<p:separator />
						
					<div>
						<p:commandButton image="voltar" value="Voltar" immediate="true" onclick="dlgCalcularOrcamentoCustoOperacional.hide()" />
					    <p:commandButton image="avancar2" value="Avançar" update="dlgCalcularOrcamentoTotalOrcamental" actionListener="#{orcamentoMB.inserirCustoOperacional}" oncomplete="dlgCalcularOrcamentoTotalOrcamental.show();" />
					</div>
										
				</div>				
			</p:dialog>
			
			<p:dialog showEffect="slide" 
				  hideEffect="slide" 
				  id="dlgCalcularOrcamentoTotalOrcamental" 
				  widgetVar="dlgCalcularOrcamentoTotalOrcamental"
				  header="Calcular Orçamento" 
				  modal="true" 
				  resizable="false"
				  closable="false"
				  position="center center"
				  style="height:auto">				
				<div style="font-size:14px;">
					<center>
						<p:panelGrid columns="2">  
						    <f:facet name="header">  
						        Total Orçamental  
						    </f:facet>
						    				
							<h:outputLabel for="qtdHorasViagem" value="Qtd. Horas Viagem" />  
						    <pe:inputNumber id="qtdHorasViagem" decimalPlaces="0" roundMethod="S" value="#{orcamentoMB.selectedOrcamento.valorOrcamento.totalOrcamental.qtdHorasViagem}" required="true" tabindex="1" requiredMessage="Necessário preencher a quantidade de horas de viagem!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="qtdHorasViagem,totalOrcamento,totalOrcamentoDesconto,valorLucro,qtdHorasCustoFixo" listener="#{orcamentoMB.calcularTotalOrcamento}"/>
						    </pe:inputNumber>					    				
						    						   
						    <h:outputLabel for="qtdHorasVistoria" value="Qtd. Horas Vistoria" />  
						    <pe:inputNumber id="qtdHorasVistoria" decimalPlaces="0" roundMethod="S" value="#{orcamentoMB.selectedOrcamento.valorOrcamento.totalOrcamental.qtdHorasVistoria}" required="true" tabindex="1" requiredMessage="Necessário preencher a quantidade de horas de vistoria!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="qtdHorasVistoria,totalOrcamento,totalOrcamentoDesconto,valorLucro,qtdHorasCustoFixo" listener="#{orcamentoMB.calcularTotalOrcamento}"/>
						    </pe:inputNumber>
						    
						    <h:outputLabel for="qtdHorasComplementos" value="Qtd. Horas Complementos" />  
						    <pe:inputNumber id="qtdHorasComplementos" decimalPlaces="0" roundMethod="S" value="#{orcamentoMB.selectedOrcamento.valorOrcamento.totalOrcamental.qtdHorasComplementos}" required="true" tabindex="1" requiredMessage="Necessário preencher a quantidade de horas de complementos!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="qtdHorasComplementos,totalOrcamento,totalOrcamentoDesconto,valorLucro,qtdHorasCustoFixo" listener="#{orcamentoMB.calcularTotalOrcamento}"/>
						    </pe:inputNumber>
						    
						    <h:outputLabel for="qtdHorasCustoFixo" value="Qtd. Horas Custo Fixo" />  
						    <pe:inputNumber id="qtdHorasCustoFixo" decimalPlaces="0" roundMethod="S" value="#{orcamentoMB.selectedOrcamento.valorOrcamento.totalOrcamental.qtdHorasCustoFixo}" required="true" tabindex="1" requiredMessage="Necessário preencher a quantidade de horas de custo fixo!" size="15" readonly="true" style="background-color:#EEE9E9">
						    	<p:ajax event="blur" update="qtdHorasCustoFixo,totalOrcamento,totalOrcamentoDesconto,valorLucro" listener="#{orcamentoMB.calcularTotalOrcamento}"/>
						    </pe:inputNumber>
						    
						    <h:outputLabel for="porcentagemLucro" value="Porcentagem de Lucro(%)" />  
						    <pe:inputNumber id="porcentagemLucro" decimalPlaces="2" roundMethod="S" decimalSeparator="," thousandSeparator="." value="#{orcamentoMB.selectedOrcamento.valorOrcamento.totalOrcamental.porcentagemLucro}" required="true" tabindex="1" requiredMessage="Necessário preencher a porcentagem de lucro!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="porcentagemLucro,totalOrcamento,totalOrcamentoDesconto,valorLucro" listener="#{orcamentoMB.calcularTotalOrcamento}"/>
						    </pe:inputNumber>
						    
						    <h:outputLabel for="valorLucro" value="Valor do Lucro(R$)" />  
						    <pe:inputNumber id="valorLucro" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.selectedOrcamento.valorOrcamento.totalOrcamental.valorLucro}" required="true" tabindex="1" requiredMessage="Necessário preencher o valor do lucro!" size="15" readonly="true" style="background-color:#EEE9E9">
						    	<p:ajax event="blur" update="valorLucro,totalOrcamento,totalOrcamentoDesconto" listener="#{orcamentoMB.calcularTotalOrcamento}"/>
						    </pe:inputNumber>
						    
						    <h:outputLabel for="descontoOrcamento" value="Desconto no Orçamento(%)" />  
						    <pe:inputNumber id="descontoOrcamento" decimalPlaces="2" decimalSeparator="," roundMethod="S" thousandSeparator="." value="#{orcamentoMB.selectedOrcamento.valorOrcamento.totalOrcamental.descontoOrcamento}" required="true" tabindex="1" requiredMessage="Necessário preencher o desconto no orçamento!" size="15" style="background-color:#FFFF00">
						    	<p:ajax event="blur" update="descontoOrcamento,totalOrcamento,totalOrcamentoDesconto" listener="#{orcamentoMB.calcularTotalOrcamento}"/>
						    </pe:inputNumber>
						    										
						</p:panelGrid>
					</center>
					
					<p:spacer height="20" />
					
					<center>
						<h:panelGrid id="pnlGridEncargosTotalOrcamental" columns="3">
							<h:outputLabel value="Descrição" />
							<h:outputLabel value="Valor(%)" />
							<h:outputLabel value="" />
																		
							<p:inputText id="descricao" value="#{orcamentoMB.encargo.descricao}" size="30" style="background-color:#FFFF00"/>
							<pe:inputNumber id="porcentagemEncargo" decimalPlaces="2" roundMethod="S" decimalSeparator="," thousandSeparator="." value="#{orcamentoMB.encargo.porcentagemEncargo}" size="10" style="background-color:#FFFF00"/>
							<p:commandButton actionListener="#{orcamentoMB.inserirEncargo}" update="pnlGridEncargosTotalOrcamental,pnlScrollEncargos,totalOrcamento,totalOrcamentoDesconto" image="adicionar" title="Adicionar Encargo" />					
						</h:panelGrid>
					</center>
					
					<div style="font-size:14px;">
						<p:scrollPanel id="pnlScrollEncargos" style="width:auto;height:100px">
							<p:dataTable style="font-size:14px;" 
					    			 id="tblEncargosTotalOrcamental" 
					    			 var="encargo" 
					    			 widgetVar="encargo"			    			 
					    			 value="#{orcamentoMB.listaEncargos}"
					    			 paginatorPosition="bottom"
					                 emptyMessage="Nenhum encargo encontrado."
					                 selection="#{orcamentoMB.selectedEncargo}"
					                 selectionMode="single"
					                 rowKey="#{encargo.descricao}"
					                 paginator="true" 
					                 rows="5"  
					                 paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
					                 rowsPerPageTemplate="5,10,15">  
						        <f:facet name="header">  
						  			<p:outputPanel>  
						                <h:outputText value="Encargos" />			                  
						            </p:outputPanel>  
						  		</f:facet>
						  		
						        <p:column headerText="Descrição">
						        	<center>				        		    
						        		<h:outputText value="#{encargo.descricao}" />
						        	</center>
						        </p:column>  
						  
						        <p:column headerText="Valor(%)">
						        	<center>  
							            <h:outputText value="#{encargo.porcentagemEncargo}">
							            	<f:convertNumber minFractionDigits="0" maxFractionDigits="2"/>
							            </h:outputText>
							        </center>
						        </p:column>
						        
						        <p:column headerText="Valor(R$)">
						        	<center>  
							            <h:outputText value="#{encargo.valorEncargo}">
							            	<f:convertNumber minFractionDigits="2" maxFractionDigits="2" pattern="R$ #,##0.00"/>
							            </h:outputText>
							        </center>
						        </p:column>  
						  
						        <p:column>
					        		<center>
						        		<p:commandButton oncomplete="dlgExcluirEncargosTotalOrcamental.show()" image="deletar" title="Excluir Encargo">
						        			<f:setPropertyActionListener target="#{orcamentoMB.selectedEncargo}" value="#{encargo}" />
						        		</p:commandButton> 
						        	</center>
					        	</p:column>			        				        
						    </p:dataTable>
				  		</p:scrollPanel>
				  		<p:panelGrid columns="1">			  	
						  	<f:facet name="footer">
								<h:outputLabel for="totalOrcamento" value="Total do Orçamento" />  
							    <pe:inputNumber id="totalOrcamento" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.totalOrcamento}" readonly="true" style="margin-left:108px;background-color:#FF0000;font-weight:bold;color:#FFFFFF;" size="15" />							      
							</f:facet>
						</p:panelGrid>
						<p:panelGrid columns="1">			  	
						  	<f:facet name="footer">
								<h:outputLabel for="totalOrcamentoDesconto" value="Total do Orçamento com Desconto" />  
							    <pe:inputNumber id="totalOrcamentoDesconto" decimalSeparator="," roundMethod="S" decimalPlaces="2" emptyValue="zero" thousandSeparator="." symbol="R$ " value="#{orcamentoMB.totalOrcamentoDesconto}" readonly="true" style="margin-left:5px;background-color:#FF0000;font-weight:bold;color:#FFFFFF;" size="15" />
							</f:facet>
						</p:panelGrid>
					</div>
										
					<p:separator />
						
					<div>
						<p:commandButton image="voltar" value="Voltar" immediate="true" onclick="dlgCalcularOrcamentoTotalOrcamental.hide()" />
					    <p:commandButton image="confirmar" value="Finalizar" ajax="true" oncomplete="handleComplete2(xhr, status, args)" update=":form:message" actionListener="#{orcamentoMB.inserirTotalOrcamental}" onstart="dlgRanking.hide();dlgCalcularOrcamentoCustoFixo.hide();dlgCalcularOrcamentoCustoProfissionais.hide();dlgCalcularOrcamentoCustoOperacional.hide();dlgCalcularOrcamentoTotalOrcamental.hide();"/>
					</div>
										
				</div>							
			</p:dialog>			
		</h:form>
		
		<h:form prependId="true" id="formDlgExcluir">
			<p:confirmDialog id="dlgExcluir" message="Tem certeza que deseja excluir o cliente selecionado?" closable="false" header="Atenção!!!" severity="alert" widgetVar="dlgExcluir" style="font-size:14px;">  
                <p:commandButton id="confirm" image="confirmar" value="Sim" update=":form:message,:form:tblClientes" oncomplete="dlgExcluir.hide()" actionListener="#{clienteMB.excluirCliente}" />  
		        <p:commandButton id="decline" image="cancelar" value="Não" onclick="dlgExcluir.hide()" type="button" />
		        <h:outputLabel value="#{clienteMB.selectedCliente.codigo.id} - #{clienteMB.selectedCliente.razaoSocial}" style="font-weight:bold;"/>   
		    </p:confirmDialog> 
		</h:form>
		<h:form prependId="true" id="formDlgOrcamento">
			<p:confirmDialog id="dlgOrcamento" message="Tem certeza que deseja solicitar um orçamento para o cliente selecionado?" closable="false" header="Atenção!!!" severity="alert" widgetVar="dlgOrcamento" style="font-size:14px;">  
                <p:commandButton id="confirm" image="confirmar" value="Sim" update=":form:message,:formDlgRanking:tblOrcamentos" oncomplete="dlgOrcamento.hide()" actionListener="#{clienteMB.solicitarOrcamento}" />  
		        <p:commandButton id="decline" image="cancelar" value="Não" onclick="dlgOrcamento.hide()" type="button" />
		        <h:outputLabel value="#{clienteMB.selectedCliente.codigo.id} - #{clienteMB.selectedCliente.razaoSocial}" style="font-weight:bold;"/>   
		    </p:confirmDialog> 
		</h:form>
		<h:form prependId="true" id="formDlgExcluirProfissional">
			<p:confirmDialog id="dlgExcluirProfissional" message="Tem certeza que deseja excluir o profissional selecionado?" closable="false" header="Atenção!!!" severity="alert" widgetVar="dlgExcluirProfissional" style="font-size:14px;">  
                <p:commandButton id="confirm" image="confirmar" value="Sim" update=":formDlgCalcularOrcamento:tblCustoProfissionais" oncomplete="dlgExcluirProfissional.hide()" actionListener="#{orcamentoMB.removerProfissional}" />  
		        <p:commandButton id="decline" image="cancelar" value="Não" onclick="dlgExcluirProfissional.hide()" type="button" />		           
		    </p:confirmDialog> 
		</h:form>
		<h:form prependId="true" id="formDlgExcluirEncargosTotalOrcamental">
			<p:confirmDialog id="dlgExcluirEncargosTotalOrcamental" message="Tem certeza que deseja excluir o encargo selecionado?" closable="false" header="Atenção!!!" severity="alert" widgetVar="dlgExcluirEncargosTotalOrcamental" style="font-size:14px;">  
                <p:commandButton id="confirm" image="confirmar" value="Sim" update=":formDlgCalcularOrcamento:pnlScrollEncargos,:formDlgCalcularOrcamento:totalOrcamento,:formDlgCalcularOrcamento:totalOrcamentoDesconto" oncomplete="dlgExcluirEncargosTotalOrcamental.hide()" actionListener="#{orcamentoMB.removerEncargo}" />  
		        <p:commandButton id="decline" image="cancelar" value="Não" onclick="dlgExcluirEncargosTotalOrcamental.hide()" type="button" />		           
		    </p:confirmDialog> 
		</h:form>
		
		<script type="text/javascript">  
			function handleComplete(xhr, status, args) {  
			    if(args.validouOrcamento) {  
			    	document.getElementById('formDlgRanking:btnGerarOrcamento').click();			    	
			    } 
			}
			
			function handleComplete2(xhr, status, args) {  
			    document.getElementById('formDlgRanking:btnGerarOrcamento').click();			     
			}
		</script>
	</h:body>
</html>